package com.group.itms.routes.utils;

import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.group.itms.routes.R;
import com.group.itms.routes.adapters.MultiViewTypeAdapter;

public class Header implements ListViewItem {

	private String mValue;
	private Object mData;
	
	public Header(String value) {
		this(value, null);
	}
	
	
	public Header(String value, Object data) {
		mValue = value;
		mData = data;
	}
	
	@Override
	public int getViewType() {
		return MultiViewTypeAdapter.VIEW_TYPE_HEADER;
	}

	@Override
	public View getView(LayoutInflater inflater, View convertView) {
		View v = convertView != null ? convertView : inflate(inflater); 
		((TextView) v.findViewById(R.id.tvHeader)).setText(mValue);
		return v;
	}
	
	private View inflate(LayoutInflater inflater) {
		return inflater.inflate(R.layout.header_layout, null);
	}

	@Override
	public Object getData() {
		return mData;
	}

	@Override
	public boolean isClickable() {
		return false;
	}

}
